import 'package:flutter/material.dart';
import 'package:tender_flutter/constant/theme_colors.dart';
import 'package:tender_flutter/page/home/model/tender_entity.dart';
import 'package:tender_flutter/utils/screen_adaper.dart';

class TrackDynamicListCell extends StatelessWidget {
  const TrackDynamicListCell(
      {Key key, this.data, this.onTap, this.deleteCallback})
      : super(key: key);

  final TenderList data;
  final GestureTapCallback onTap;
  final GestureTapCallback deleteCallback;

  @override
  Widget build(BuildContext context) {
    return _initCell();
  }

  Widget _initCell() {
    return GestureDetector(
        onTap: onTap,
        child: Container(
          width: double.infinity,
          color: ThemeColors.colorWhite,
          child:
              Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
            Row(
              children: <Widget>[
                Container(
                  width: ScreenAdapter.width(100),
                  height: ScreenAdapter.width(100),
                  margin: EdgeInsets.only(
                      left: ScreenAdapter.width(30),
                      right: ScreenAdapter.width(18)),
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                      color: ThemeColors.colorType6,
                      borderRadius:
                          BorderRadius.circular(ScreenAdapter.width(14))),
                  child: Text("企",
                      style: TextStyle(
                          color: ThemeColors.colorWhite,
                          fontSize: ScreenAdapter.sp(40),
                          fontWeight: FontWeight.bold)),
                ),
                Container(
                  margin: EdgeInsets.only(
                      top: ScreenAdapter.height(30),
                      bottom: ScreenAdapter.height(30)),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      Text(
                        data.zbCompanyName ?? "",
                        style: TextStyle(
                            color: ThemeColors.colorType1,
                            fontSize: ScreenAdapter.sp(32),
                            fontWeight: FontWeight.w500),
                      ),
                      SizedBox(height: ScreenAdapter.height(20)),
                      Row(
//                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: <Widget>[
                          Container(
                              padding: EdgeInsets.only(
                                  left: ScreenAdapter.width(15),
                                  right: ScreenAdapter.width(15),
                                  top: ScreenAdapter.width(6),
                                  bottom: ScreenAdapter.width(6)),
                              child: Text(data.type ?? "",
                                  style: TextStyle(
                                      color: ThemeColors.colorType40,
                                      fontSize: ScreenAdapter.sp(24))),
                              decoration: BoxDecoration(
                                  color: ThemeColors.colorType20,
                                  borderRadius: new BorderRadius.circular(3))),
                          SizedBox(width: ScreenAdapter.width(20)),
                          Text(data.date ?? "",
                              style: TextStyle(
                                  color: ThemeColors.colorType7,
                                  fontSize: ScreenAdapter.sp(28))),
                        ],
                      )
                    ],
                  ),
                )
              ],
            ),
            Container(
                margin: EdgeInsets.only(
                    left: ScreenAdapter.width(30),
                    right: ScreenAdapter.width(30),
                    bottom: ScreenAdapter.height(30)),
                padding: EdgeInsets.all(ScreenAdapter.width(20)),
                decoration: BoxDecoration(
                    color: ThemeColors.colorType55,
                    borderRadius:
                        BorderRadius.circular(ScreenAdapter.width(10))),
                child: Text(data.title ?? "无",
                    style: TextStyle(
                        color: ThemeColors.colorType7,
                        fontSize: ScreenAdapter.sp(28))))
          ]),
        ));
  }
}
